<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>测试页面</title>
</head>
<body>
  <h1>测试页面</h1>
  <button >测试一下</button>
  <button id="pickerPhoto">pickerPhoto-相册服务</button>
  <button id="cameraPlugin">cameraPlugin-相机拍照</button>
  <button id="sensorPlugin">sensorPlugin-抖动</button>
  <button id="getAreaColumns">getAreaColumns-省市区数据</button>
  <!-- <p>{{userInfo}}</p> -->
   <br/>
  <img style="width: 100px" src="" alt="" />
</body>
<script>
  document.querySelector('button').addEventListener('click', async()=>{
    // mk.sayHi('测试一下')
    // console.log(window.mk);
    const userInfo = mk.queryUser();
    // document.querySelector("p").innerText = JSON.stringify(userInfo);
    // mk.removeUser()
  } )
  document.querySelector('#pickerPhoto').addEventListener('click', async()=>{
    const res = await mk.pickerPhoto()
    console.log(res);
      // 显示 base64 图片,需要添加前缀标识，否者图片无法展示
      document.querySelector("img").src = `data:image/jpeg;base64,${res}`;
  })
  document.querySelector('#cameraPlugin').addEventListener('click', async()=>{
    const res = await mk.cameraPlugin()
    console.log(res);
      // 显示 base64 图片,需要添加前缀标识，否者图片无法展示
      document.querySelector("img").src = `data:image/jpeg;base64,${res}`;
  })
  //使手机抖动
  document.querySelector('#sensorPlugin').addEventListener('click', async()=>{
    const res = await mk.sensorPlugin()
    console.log(res);
  })
  // 获取省市区数据
  document.querySelector('#getAreaColumns').addEventListener('click', async()=>{
    const res = await mk.getAreaColumns()
    console.log(res);
  })
 
</script>
<!-- 引入调试控制台 -->
<script src="./eruda.min.js"></script>
<script>eruda.init();</script>
</html>